package com.scpii.universal.pns.service;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.scpii.universal.pns.dto.MessageDto;
import com.scpii.universal.pns.dto.MsgManageDto;
import com.scpii.universal.pns.entity.PnsGroup;
import com.scpii.universal.pns.entity.PnsMessage;
import com.scpii.universal.pns.entity.PnsUser;

public interface PnsMessageService extends PnsBaseService<PnsMessage, Integer>  {

	/**
	 * 
	 * 推送消息 初始化页面
	 * 
	 * @author zhangqiang 2012-11-20上午09:28:38
	 * @param appId 
	 */
	public List<PnsGroup> getPnsInit(Integer enterpId, Integer appId);

	/**
	 * 获取目标用户群体的信息，
	 * @param appId TODO
	 * @param request
	 * @param response
	 */
	public List<PnsUser> getUserinfo(PnsUser condition, Integer pageNo, Integer pageSize, Integer appId);

	/**
	 * 保存新建的推送消息 目标组
	 * 
	 * @param request
	 * @param response
	 */
	public Integer saveGroupInfo(PnsGroup pnsGroup, String userIds, Integer appId);

	/**
	 * 保存推送信息
	 * @param request
	 * @param appId
	 * @param response
	 * 
	 * @throws Exception
	 */
	public Integer saveMessageInfo(MessageDto msgDto, HttpServletRequest request, String groupIds, int enterpId, Integer appId,String webRoot)
			throws Exception;

	public void saveMsgGroup(Integer messageId, Integer enterpId, Integer appId) ;

	/**
	 * 获取消息的条数
	 * 
	 * @param enterId
	 * @param appId
	 * @return
	 * @author zhangqiang 2012-11-26下午02:07:09
	 */
	public Integer getMessgetCount(Integer enterId, Integer appId);

	/**
	 * 获取消息信息
	 * 
	 * @param enterId
	 * @param appId
	 * @return
	 * @author zhangqiang 2012-11-26下午02:15:14
	 */
	public List<MsgManageDto> getPnsManage(Integer enterId, Integer pageNo, Integer pageSize, Integer appId);

	public void delgroupByName(PnsGroup pnsGroup);
	
	/**
	 * 通过medsageId 查找group
	 * 
	 * @param appId
	 * @param messageId
	 * @return
	 */
	public List<PnsGroup> getGroupByMessageId(Integer appId,Integer messageId);
	
	public void updateMessageStatus(Integer messageId);
}
